import { Body, Controller, Get, Post, Query } from '@nestjs/common'
import { DocService, VersionService } from '@/service'
import { IYuqueDoc } from '@/interface'
import { FlowDto } from '@/controller/index.dto'

@Controller('notify')
export class NotifyControllers {
    constructor(private readonly docService: DocService, private readonly versionService: VersionService) {}

    @Post('yuque')
    public async yuque(@Body('data') data: IYuqueDoc) {
        return await this.docService.notify(data)
    }

    @Get('flow')
    public async flow(@Query() query: FlowDto) {
        return await this.versionService.notify(query)
    }
}
